<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>时光桥梁后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <%--<link rel="shortcut icon" href="${pageContext.request.contextPath}/font/favicon.ico" type="image/x-icon"/>--%>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main/xadmin.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/swiper.min.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/login/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/swiper.jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/main/xadmin.js"></script>

</head>
<body>
<!-- 中部开始 -->
<div class="wrapper">
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <form class="layui-form">
                <input type="text" name="mid" id="mid" value="${mid}" hidden="hidden"/>
                <input type="text" name="eid" id="eid" value="${element.eid}" hidden="hidden">
                <div class="layui-form-item">
                    <label for="name" class="layui-form-label">
                        <span class="x-red">*</span>公告名称
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="name" name="name" required="" value='${element.name}'
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="count" class="layui-form-label">
                        <span class="x-red">*</span>公告内容
                    </label>
                    <div class="layui-input-inline">
                        <%--<input type="text" id="desc" name="desc" required="" value="${service.desc}"--%>
                        <%--autocomplete="off" class="layui-input">--%>
                        <textarea name="count" class="layui-textarea" id="count" cols="30"
                                  rows="10">${element.count}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="editblog" class="layui-form-label">
                    </label>
                    <input type="button" id="editblog" value="修改" class="layui-btn">

                    </input>
                </div>
            </form>
            <!-- 右侧内容框架，更改从这里结束 -->
        </div>
    </div>
    <!-- 右侧主体结束 -->
</div>
<!-- 中部结束 -->
<script>
    //百度统计可去掉
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>

<script>
    $("#editblog").click(function () {
        $.ajax({
            type: "post",
            url: "${pageContext.request.contextPath}/editblog.do",
            data: {
                eid: $("#eid").val(),
                name: $("#name").val(),
                count: $("#count").val()
            },
            success: function (s) {
                if (s.success) {
                    alert(s.msg);
                    <%--window.location.href = "${pageContext.request.contextPath}/blogelement.do?mid="+mid;--%>
                    x_admin_close();
                } else {
                    alert(s.msg);
                }
            }
        })
    });
</script>
</html>